package main

import (
	"fmt"
	"time"
)

func main() {
	now := time.Now()
	fmt.Printf("now =%v, %T \n", now, now)
	// 年月日 时分秒
	fmt.Printf("年=%v \n", now.Year())
	fmt.Printf("月=%v \n", now.Month())
	fmt.Printf("月=%v \n", int(now.Month()))
	fmt.Printf("日=%v \n", now.Day())
	fmt.Printf("时=%v \n", now.Hour())
	fmt.Printf("分=%v \n", now.Minute())
	fmt.Printf("年秒=%v \n", now.Second())

	fmt.Println(now.Format("2006/01/02 15:04:05"))
	fmt.Println(now.Format("2006/01/02"))

	time.Sleep(time.Second)
	fmt.Println(now.Unix())
	fmt.Println(now.UnixNano())

}
